// import Vue, {createApp} from 'vue'
// import {createStore} from 'vuex'
// import App from '../App'
// import getters from './getters'
//
// // Vue.use(Vuex)
// // createApp(App).use(Vuex)
//
// // https://webpack.js.org/guides/dependency-management/#requirecontext
// const modulesFiles = require.context('./modules', true, /\.js$/)
//
// // you do not need `import app from './modules/app'`
// // it will auto require all vuex module from modules file
// const modules = modulesFiles.keys().reduce((modules, modulePath) => {
//     // set './app.js' => 'app'
//     const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
//     const value = modulesFiles(modulePath)
//     modules[moduleName] = value.default
//     return modules
// }, {})
//
// const store = new createStore({
//     modules,
//     getters
// })
//
// export default store



// import Vue, {createApp} from 'vue'
import Vuex from 'vuex'
import menus from "@/store/modules/menus";
import App from '../App'
import {createApp} from "vue";
import Vue from "vue";
createApp(App).use(Vuex)
const app = createApp(App)
app.config.globalProperties.Vuex = Vuex

export default new Vuex.Store({
    state: {
        token: '',
    },
    mutations: {
        SET_TOKEN: (state, token) => {
            state.token = token;
            localStorage.setItem("token", token);
        },


    },
    actions: {
    },
    modules: {
        menus
    }
})
